// process_traits_posix.hpp

#ifndef PROCESS_TRAITS_POSIX_HPP_GUARD
#define PROCESS_TRAITS_POSIX_HPP_GUARD

#include <iostream>
#include <memory>
#include <stdexcept>

#ifdef __GNUC__
# define DSOLOCAL __attribute__ ((visibility("hidden")))
#else
# define DSOLOCAL
#endif

namespace process {
    namespace detail {

        struct DSOLOCAL process_traits_posix {
            process_traits_posix(const char *cmd, int flags);

            int pid_;

            int in_fd_;
            int out_fd_;
            int err_fd_;

            std::auto_ptr<std::istream> from_;
            std::auto_ptr<std::istream> error_;
            std::auto_ptr<std::ostream> to_;

            int poll(void) const;
            int wait(void);

            ~process_traits_posix();

        private:
        };

        typedef process::detail::process_traits_posix process_traits_impl;

    } // namespace detail
} // namespace process

#endif
